<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>7_文本溢出替换为省略号</title>
    <style>
        div {
            background-color: #ff0;
            width: 200px;
            /* 以下三句必须同时出现才能实现效果 */
            white-space: nowrap;/* 设置不换行 */
            overflow: hidden;/* 设置溢出隐藏 */
            text-overflow: ellipsis;/* 设置文字溢出替换为省略号 */
        }
    </style>
</head>
<body>
    <div>
        Lorem ipsum dolor sit amet, consectetur adipisicing elit. Alias culpa deserunt earum illo pariatur possimus quos sequi voluptate. Commodi consectetur corporis distinctio enim minima nulla odit perferendis praesentium recusandae voluptate.
    </div>
</body>
</html>